<%--
  Created by IntelliJ IDEA.
  User: jun jie
  Date: 2022/9/28
  Time: 0:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>

    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>

    <script>
      function a(){
        $.post({
            url:"${pageContext.request.contextPath}/a1",
            data:{"name":$("#username").val()},
            success:function (data){
                alert(data);
            }
        })
      }
    </script>

  </head>
  <body>
    <%-- 失去焦点的时候，发起一个请求到后台 --%>

    用户名:<input type="text" id="username" onblur="a()">
  </body>
</html>
